Zigbee Switch: Add support/handling for Stateless Step Capabilities#2818
Zigbee Switch: Add support/handling for Stateless Step Capabilities#2818
Conversation
|
Invitation URL: |
Test Results 72 files 494 suites 0s ⏱️ Results for commit 82cdfe2. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 82cdfe2 |
535962c to
cf1fc47
Compare
|
Duplicate profile check: Warning - duplicate profiles detected. |
3d5baa4 to
8855768
Compare
c0a48c5 to
f4a7af9
Compare
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
f10a277 to
1bbafc5
Compare
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
1bbafc5 to
21d5850
Compare
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
4ad4ca3 to
75ef0dc
Compare
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-switch/src/stateless_handlers/can_handle.lua
Outdated
Show resolved
Hide resolved
671071f to
2023b46
Compare
2023b46 to
2a1d09d
Compare
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
| local kelvin_min = device:get_field(switch_utils.KELVIN_MIN); | ||
| local kelvin_max = device:get_field(switch_utils.KELVIN_MAX); |
There was a problem hiding this comment.
These fields are set with the endpoint appended to the field name, but are being read here without the endpoint.
There was a problem hiding this comment.
Also noticed that the 3 lines above here have semicolons at the end that should be removed
There was a problem hiding this comment.
done to both. This was a bit of a weird issue- in matter we have the component_to_endpoint logic to get endpoints from a component, but in zigbee we don't. For now, I removed the endpoint logic altogether, so we cannot support different bounds across parent/child zigbee bulbs. I think this is an ok trade-off for the work it might take to add new infrastructure to handle this.
74f650c to
555e4e3
Compare
| local COLOR_TEMPERATURE_MIRED_MAX = 1000 -- 15000 Kelvin | ||
| local COLOR_TEMPERATURE_MIRED_MIN = 67 -- 1000 Kelvin |
There was a problem hiding this comment.
A note to reviewers- while looking at this all, I started noticing that while we are saving these fields in Kelvin, almost all functionality involving these occurs in Mireds. Therefore, I have altered the flow to more directly use mireds, only converting into kelvin at the specific colorTemperatureRange step.
I believe this should simplify the constant conversion back and forth.
| -- Copyright 2026 SmartThings, Inc. | ||
| -- Licensed under the Apache License, Version 2.0 | ||
|
|
||
| local capabilities = require "st.capabilities" |
There was a problem hiding this comment.
nit: Move this inside the function call for slight memory savings
There was a problem hiding this comment.
I'm not sure that will cause savings in this case, since st.capabilities is already required at the top of the main init.lua file.
6a091be to
0d7e0a1
Compare
drivers/SmartThings/zigbee-switch/src/color_temp_range_handlers/init.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua
Outdated
Show resolved
Hide resolved
| local clusters = require "st.zigbee.zcl.clusters" | ||
| local switch_utils = require "switch_utils" | ||
|
|
||
| -- These values are the mired versions of the config bounds in the default profiles |
There was a problem hiding this comment.
Which default profiles is this comment referring to? color-temp-bulb.yml uses 2700K for example. I'm guessing this really just means a default range that would represenet the widest supported color temp range across all of the profiles?
There was a problem hiding this comment.
Just made some updates, I'd originally used the Matter default profiles (which use 2200) as the basis, but decided to use the default Zigbee bounds instead, like you'd pointed out.
nickolas-deboom
left a comment
There was a problem hiding this comment.
Left some minor comments but the rest looks good to me 👍
0387687 to
36bbf2b
Compare
Co-authored-by: Harrison Carter <harrison.carter@smartthings.com>
36bbf2b to
82cdfe2
Compare
| else | ||
| device.log.warn_with({hub_logs = true}, string.format("Device reported a min color temperature %d K that is not lower than the reported max color temperature %d K", temp_in_kelvin, max)) | ||
| end | ||
| device:set_field(switch_utils.MIRED_MAX_BOUND, max_mired_bound, {persist = true}) |
There was a problem hiding this comment.
Whats the reason for removing the endpoint from these field names? Same here:
There was a problem hiding this comment.
oops, I resolved the conversation where this was discussed. See here
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests